home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-19 | 3.4 KB | 145 lines | [TEXT/MPS ] |
- execute "{OpenDocBuildSupportDir}BMCommon"
-
- set exit 0
-
- alias CSrcFile 'evaluate "{srcFile}" =~ /?+.c/'
- alias CppSrcFile 'evaluate "{srcFile}" =~ /?+.cp[p]*/'
-
- set srcFile "`windows -q | streamedit -e '$ Print .;/?+/ Delete'`"
-
- set TargetArch "`streamedit -e "{capat}" "{ProjPrefs}"`"
- execute "{OpenDocBuildSupportDir}BMSettings"
-
- # ----------------------------
- # MODIFY READ-ONLY SOURCE FILE
- # ----------------------------
-
- if "{1}" == "-mro"
- ModifyReadOnly "{srcFile}"
-
- # ----------------------
- # PREPROCESS SOURCE FILE
- # ----------------------
-
- else if "{1}" == "-p"
- (evaluate "{srcFile}" =~ /?+:([¬:]+.c[p]*)®1/) ∑∑ dev:null
- set srcFileName "{®1}"
- unset ®1
-
- set prepFile "{TempFolder}{srcFileName}.e"
-
- if "{TargetArch}" == "PPC"
- if ( `CSrcFile` )
- set buildcmd "{PPCCPreprocessor} {PPCCompilerOptions} {ODCIncludes} -e -l '{prepFile}'"
- else if ( `CppSrcFile` )
- set buildcmd "{PPCCppPreprocessor} {PPCCompilerOptions} {ODCppIncludes} -e -l '{prepFile}'"
- else
- Echo # Error: not sure how to preprocess this file
- Exit 1
- end
- else
- if ( `CSrcFile` )
- set buildcmd "{68kCPreprocessor} -c {68kCompilerOptions} {ODCIncludes} -e -o '{prepFile}'"
- else if ( `CppSrcFile` )
- set buildcmd "{68kCppPreprocessor} {68kCompilerOptions} {ODCppIncludes} -e -o '{prepFile}'"
- else
- Echo # Error: not sure how to preprocess this file
- Exit 1
- end
- end
-
- #Echo "{buildcmd} '{srcFile}'" >> "{WorkSheet}"
- {buildcmd} "{srcFile}" ∑∑ "{Worksheet}"
- open "{prepFile}"
-
- # -------
- # COMPILE
- # -------
-
- else if "{1}" == "-c"
- if "{TargetArch}" == "PPC"
- if ( `CSrcFile` )
- set buildcmd "{PPCCCompiler} {PPCCompilerOptions} {ODCIncludes}"
- else if ( `CppSrcFile` )
- set buildcmd "{PPCCppCompiler} {PPCCompilerOptions} {ODCppIncludes}"
- else
- Echo # Error: not sure how to compile this file
- Exit 1
- end
- else
- if ( `CSrcFile` )
- set buildcmd "{68kCCompiler} {68kCompilerOptions} {ODCIncludes}"
- else if ( `CppSrcFile` )
- set buildcmd "{68kCppCompiler} {68kCompilerOptions} {ODCppIncludes}"
- else
- Echo # Error: not sure how to compile this file
- Exit 1
- end
- end
-
- #Echo "{buildcmd} '{srcFile}' -o '{TempFolder}'" >> "{WorkSheet}"
- {buildcmd} "{srcFile}" -o "{TempFolder}" ∑∑ "{Worksheet}"
-
- # -----------
- # DISASSEMBLE
- # -----------
-
- else if "{1}" == "-d"
- (evaluate "{srcFile}" =~ /?+:([¬:]+.c[p]*)®1/) ∑∑ dev:null
- set srcFileName "{®1}"
- unset ®1
-
- set disFile "{TempFolder}{srcFileName}.o.dis"
-
- if ( `exists "{disFile}"` == "" )
- set ans `Confirm "“{srcFileName}” has not been compiled yet. Shall I compile and then disassemble it?"`
-
- if ( ans == 0 )
- BMCompile -c
- else if ( ans == 4 )
- Exit 0
- end
- end
-
- if "{TargetArch}" == "PPC"
- dumpxcoff -tb -u -ln "{TempFolder}{srcFileName}.o" > "{disFile}"
- else
- dumpobj "{TempFolder}{srcFileName}.o" > "{disFile}"
- end
-
- open "{disFile}"
-
- # ------------
- # MAKE PROJECT
- # ------------
-
- else if "{1}" == "-m"
- if "{TargetArch}" == "PPC"
- if ( `CSrcFile` )
- set compiler "{PPCCCompiler}"
- else if ( `CppSrcFile` )
- set compiler "{PPCCppCompiler}"
- else
- Echo # Error: not sure how to compile this file
- Exit 1
- end
- else
- if ( `CSrcFile` )
- set compiler "{68kCCompiler}"
- else if ( `CppSrcFile` )
- set compiler "{68kCppCompiler}"
- else
- Echo # Error: not sure how to compile this file
- Exit 1
- end
- end
-
- set makefile "`streamedit -e "{pfpat}" "{ProjPrefs}"`"
- BuildOpenDocPart -f "{makefile}" -b "{compiler}"
-
- end
-
-
- set exit 1
-
-